<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>s
		<textarea id="input_text" cols="80" rows="2">http://127.0.0.1:9090/jsonp</textarea>
		<button id="send">发送jsonp</button>
		<pre id="content"></pre>
		<script>
			window.jsonpcallback = function (res) {
				console.log(res);
				content.innerHTML = JSON.stringify(res, null, 2);
			}
			send.onclick = function() {
				// 发起jsonp
				let script = document.createElement("script")
				script.setAttribute("src", `${input_text.value}?cb=jsonpcallback`)
				document.body.appendChild(script);
				script.onload = () => {
					script.remove();
				}
			}
		</script>
		<!-- <script id="GET" src="http://localhost:8000?cb=jsonpcallback"></script> -->
	</body>
</html>